package main.java.indi.zyj.c150.recursion;

public class _06_CharArraysSort {


    private static int indexof(String[] chars, String target){
        int begin = 0, end = chars.length - 1;
        while (begin <= end){
            int mid = begin + ((end - begin) >> 1);
            while (chars[mid].equals("")){
                mid++;
                if (mid > end){
                    mid = end - 1;
                }
            }
            if (chars[mid].compareTo(target) > 0){
                end = mid - 1;
            }else if (chars[mid].compareTo(target) < 0){
                begin = mid + 1;
            }else {
                return mid;
            }
        }
        return -1;
    }

}
